import {
    LoginResult,
    MessageListParam,
    SysUserInfo,
    SysUserLoginParam
} from './BackUserModel'
import http from './http'
enum Api {
    sysUserLogin = '/sys_user/login',
    getSysUserInfo = '/sys_user/info',
    upload = '/message/upload',
    getMessageList = '/message/list'
}

// 客服登录
export async function sysUserLoginApi(params: SysUserLoginParam) {
    return await http.post<LoginResult>(Api.sysUserLogin, params)
}
// 获得客服信息
export async function getSysUserInfoApi() {
    return await http.get<SysUserInfo>(Api.getSysUserInfo)
}

// 上传文件
export async function getUploadApi(params: FormData) {
    return await http.postFile(Api.upload, params)
}
// 消息列表
export async function getMessageListApi(params: MessageListParam) {
    return await http.post(Api.getMessageList, params)
}
